Up to now, there is an electric compressor in which a temperature sensor disposed in a driver circuit unit detects a temperature of a switching device. A motor is driven by reducing an output characteristic such as rotational speed or acceleration rate according to the detected temperature. Thus, the heat generation of the driver circuit unit is suppressed when the motor starts up at a high temperature. In the electric compressor, the temperature detection is repeated by the temperature sensor to sequentially update the rotational speed or the acceleration rate of the motor. With the above configuration, the rotational speed of the motor can be changed according to a change in the temperature of the switching device of the driver circuit unit, which is attributable to the heat generation caused by the switching operation or cooling by the refrigerant (for example, refer to the following Patent Literature 1).